package com.ruoyi.repast.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.repast.entity.BPrivateRoom;
import com.ruoyi.repast.entity.BReserve;
import com.ruoyi.repast.service.BInterfaceService;
import com.ruoyi.repast.service.BPrivateRoomService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * 餐饮管理控制器
 * @author zhangjiabing
 * @date 2021/08/23 21:
 */
@Controller
@RequestMapping("/repast/interface")
public class BInterfaceController extends BaseController {

    private String prefix = "repast/interface";

    /**
     * 包间接口管理service接口
     */
    @Autowired
    private BInterfaceService bInterfaceService;

    /**
     * 包间信息查询
     */
    @PostMapping("/queryList")
    @ResponseBody
    public List<BReserve> queryReserveList(BReserve dto){

       List<BReserve> resultInfo =  bInterfaceService.queryReserveList(dto);
       return resultInfo;
    }

    /**
     * 包间信息新增
     */
    @PostMapping("/add")
    @ResponseBody
    public boolean addReserve(BReserve dto){

       boolean  resultInfo  = bInterfaceService.addReserve(dto);
       return resultInfo;

    }

    /**
     * 包间信息修改
     */
    @PostMapping("/edit")
    @ResponseBody
    public boolean editReserve(BReserve dto){

        boolean resultInfo  = bInterfaceService.editReserve(dto);
        return resultInfo;
    }

    /**
     * 包间信息删除
     */
    @PostMapping("/delete")
    @ResponseBody
    public boolean deleteReserve(BReserve dto){

        boolean resultInfo = bInterfaceService.deleteReserve(dto);
        return resultInfo;
    }
}
